package com.share.pattern;

import java.util.Scanner;

/**
 * 计算器操作类
 * 
 */

public class CalculatorOperation {
	/**
	 * v0.3 面向对象编程 
	 * 
	 * CalculatorOperation类	 
	 *   
	 * 
	 */
	public static double getResult(double numberA, double numberB, String strOpt) {

		double result = 0;
		// 判断操作符
		switch (strOpt) {
		case "+":
			result = numberA + numberB;
			break;

		case "-":
			result = numberA - numberB;
			break;

		// case "*":
		// result = numberA * numberB;
		// break;
		// case "/":
		// result = numberA / numberB;
		// break;

		default:
			break;
		}

		System.out.println("结果是： " + result);
		return result;
	}

}
